package com.isunland.managesystem.entity;

import com.isunland.managesystem.base.BaseModel;
import com.isunland.managesystem.utils.MyDateUtil;
import com.isunland.managesystem.utils.MyStringUtil;
import java.util.Date;

public class AttendanceDetail extends BaseModel {
  /** 接口返回 */
  public static final int TYPE_IN = 0;
  public static final int TYPE_OUT = 1;

  public static final int SIGN_NOT_START = 2;
  public static final int SIGN_START = 3;
  public static final int SIGN_FINISH = 4;
  public static final int SIGN_ERROR = 5;

  public static final String HAS_IMAGE_TRUE = "1";
  public static final String HAS_IMAGE_FALSE = "0";
  public static final int TYPE_KEEP = 2;
  /** 本地使用,打卡接口传递 */
  public static final String ZERO = "0.0";
  public static final String EMPTY = "";
  public static final String SIGN_IN = "in";
  public static final String SIGN_OUT = "out";
  public static final String SIGN_KEEP = "keep";
  public static final String IF_REPUBLISH_TRUE = "T";
  @SuppressWarnings("WeakerAccess") public static final String IF_REPUBLISH_FALSE = "F";
  private String id;
  private Long date;
  private String name;
  private int checkType;
  private Long checkTime;
  private String location;
  private String latitude;
  private String longitude;
  private String remark;
  private String photoPath;//打卡图片的相对路径.
  private String outId;//外勤时用于标识同一个外勤记录.
  private String attendGroupName;//考勤分组名
  private String className;  //班次名称
  private String rsignInPlace;//签到地点
  private String rsignOutPlace;//签退地点
  private String attendCardStatus;//判断打卡是否有效，T为有效
  private String attendStatusName;//考勤状态
  private String attendIdentifyNumber;//手机唯一识别号.
  private String phoneIdentifyNumber;//服务端保存的绑定的id.
  private String wifiInfo;// wifi有效性验证.
  private String ifReplenish;// 0-5点自动生成记录,11:59的签退,00:01的签到.T,F
  private String hasImage;//   //是否上传图片
  private String signType;//  打卡类型,in,out,keep.
  private String signTypeName;//  打卡类型名称.
  private String deptName;//所在部门
  private boolean firstRefresh;//是否第一次刷新,用于判断是否显示对话框.
  private boolean clickrefresh;//是否点击了刷新,用于判断是否显示提示.
  private int signStatus;//完成后跳转页面
  private boolean anim;//动画是否在执行,完成后跳转页面

  public boolean isAnim() {
    return anim;
  }

  public void setAnim(boolean anim) {
    this.anim = anim;
  }

  public String getSignTypeName() {
    return signTypeName;
  }

  public void setSignTypeName(String signTypeName) {
    this.signTypeName = signTypeName;
  }

  public boolean isLocationValid() {
    return (!MyStringUtil.equals(ZERO, latitude))
        && (!MyStringUtil.equals(ZERO, longitude))
        && (!MyStringUtil.equals(EMPTY, location));
  }

  public boolean isGenerateValid() {
    boolean isBetween = MyDateUtil.isBetween(MyDateUtil.getHourOfDay(new Date(), 0),
        MyDateUtil.getHourOfDay(new Date(), 9), new Date());
    boolean isSignOut = MyStringUtil.equals(AttendanceDetail.SIGN_OUT, getSignType());
    return isBetween && isSignOut;
  }

  public String getSignType() {
    return signType;
  }

  public void setSignType(String signType) {
    this.signType = signType;
  }

  public String getAttendIdentifyNumber() {
    return attendIdentifyNumber;
  }

  public void setAttendIdentifyNumber(String attendIdentifyNumber) {
    this.attendIdentifyNumber = attendIdentifyNumber;
  }

  public String getPhoneIdentifyNumber() {
    return phoneIdentifyNumber;
  }

  public void setPhoneIdentifyNumber(String phoneIdentifyNumber) {
    this.phoneIdentifyNumber = phoneIdentifyNumber;
  }

  public String getWifiInfo() {
    return wifiInfo;
  }

  public void setWifiInfo(String wifiInfo) {
    this.wifiInfo = wifiInfo;
  }

  public String getIfReplenish() {
    return MyStringUtil.equals(IF_REPUBLISH_TRUE, ifReplenish) ? IF_REPUBLISH_TRUE
        : IF_REPUBLISH_FALSE;
  }

  public void setIfReplenish(String ifReplenish) {
    this.ifReplenish = ifReplenish;
  }

  public String getHasImage() {
    return MyStringUtil.equals(hasImage, HAS_IMAGE_TRUE) ? HAS_IMAGE_TRUE : HAS_IMAGE_FALSE;
  }

  public void setHasImage(String hasImage) {
    this.hasImage = hasImage;
  }

  public String getAttendStatusName() {
    return attendStatusName;
  }

  public void setAttendStatusName(String attendStatusName) {
    this.attendStatusName = attendStatusName;
  }

  public String getOutId() {
    return outId;
  }

  public void setOutId(String outId) {
    this.outId = outId;
  }

  public String getLatitude() {
    return latitude;
  }

  public void setLatitude(String latitude) {
    this.latitude = latitude;
  }

  public String getLongitude() {
    return longitude;
  }

  public void setLongitude(String longitude) {
    this.longitude = longitude;
  }

  public String getPhotoPath() {
    return photoPath;
  }

  public void setPhotoPath(String photoPath) {
    this.photoPath = photoPath;
  }

  //private Map<String, Object> additionalProperties = new HashMap<String, Object>();

  /**
   * @return The id
   */
  public String getId() {
    return id;
  }

  /**
   * @param id The id
   */
  public void setId(String id) {
    this.id = id;
  }

  /**
   * @return The date
   */
  public Long getDate() {
    return date;
  }

  /**
   * @param date The date
   */
  public void setDate(Long date) {
    this.date = date;
  }

  /**
   * @return The name
   */
  public String getName() {
    return name;
  }

  /**
   * @param name The name
   */
  public void setName(String name) {
    this.name = name;
  }

  /**
   * @return The checkType
   */
  public int getCheckType() {
    return checkType;
  }

  /**
   * @param checkType The checkType
   */
  public void setCheckType(int checkType) {
    this.checkType = checkType;
  }

  /**
   * @return The checkTime
   */
  public Long getCheckTime() {
    return checkTime;
  }

  /**
   * @param checkTime The checkTime
   */
  public void setCheckTime(Long checkTime) {
    this.checkTime = checkTime;
  }

  /**
   * @return The location
   */
  public String getLocation() {
    return location;
  }

  /**
   * @param location The location
   */
  public void setLocation(String location) {
    this.location = location;
  }

  /**
   * @return The remark
   */
  public String getRemark() {
    return remark;
  }

  /**
   * @param remark The remark
   */
  public void setRemark(String remark) {
    this.remark = remark;
  }

  public String getAttendGroupName() {
    return attendGroupName;
  }

  public void setAttendGroupName(String attendGroupName) {
    this.attendGroupName = attendGroupName;
  }

  public String getClassName() {
    return className;
  }

  public void setClassName(String className) {
    this.className = className;
  }

  public String getRsignInPlace() {
    return rsignInPlace;
  }

  public void setRsignInPlace(String rsignInPlace) {
    this.rsignInPlace = rsignInPlace;
  }

  public String getRsignOutPlace() {
    return rsignOutPlace;
  }

  public void setRsignOutPlace(String rsignOutPlace) {
    this.rsignOutPlace = rsignOutPlace;
  }

  public String getAttendCardStatus() {
    return attendCardStatus;
  }

  public void setAttendCardStatus(String attendCardStatus) {
    this.attendCardStatus = attendCardStatus;
  }

  public String getDeptName() {
    return deptName;
  }

  public void setDeptName(String deptName) {
    this.deptName = deptName;
  }

  public boolean isFirstRefresh() {
    return firstRefresh;
  }

  public void setFirstRefresh(boolean firstRefresh) {
    this.firstRefresh = firstRefresh;
  }

  public boolean isClickrefresh() {
    return clickrefresh;
  }

  public void setClickrefresh(boolean clickrefresh) {
    this.clickrefresh = clickrefresh;
  }

  public int getSignStatus() {
    return signStatus;
  }

  public void setSignStatus(int signStatus) {
    this.signStatus = signStatus;
  }
  //public Map<String, Object> getAdditionalProperties() {
  //    return this.additionalProperties;
  //}

  //public void setAdditionalProperty(String name, Object value) {
  //    this.additionalProperties.put(name, value);
  //}
}
